package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.anno.TableInject;
import com.sky.dto.EmployeeDTO;
import com.sky.dto.PasswordEditDTO;
import com.sky.entity.Employee;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface EmployeeMapper {

    /**
     * 根据用户名查询员工
     * @param username
     * @return
     */
    Employee getByUsername(String username);

    /**
     * 员工添加
     * @param employee
     */
    @TableInject(OperationType.INSERT)
    void save(Employee employee);


    /**
     * 员工条件分页
     * @param name
     * @return
     */
    Page page(String name);

    /**
     * 根据id查询员工
     * @param id
     * @return
     */
    Employee findById(Long id);

    /**
     * 员工修改
     * @param employee
     */
    @TableInject(OperationType.UPDATE)
    void update(Employee employee);

    /**
     * 功能描述: 修改密码
     * @return : void
     */
    void editPassword(Employee employee);


}
